<div class="settingExamination">
	<div class="content-outer">
		<div class="classfy-exam">
			<div class="container-header">
				<span>考核项分类</span>
			</div>
			<div class="container-content">
				<ul id="tree" class="ztree"></ul>
			</div>
		</div>
		<div class="response response-info"
			ng-if="checkConfiguration.showInfo">
			请选择左侧具体考核项
		</div>
		<div class="response"
			ng-if="!checkConfiguration.showInfo">
			<div class="container-header">
				<span>{{checkConfiguration.activeCategory.checkCategoryName}}</span>
				<div class="edit">
					<div class="edit-pencil"
							authorization-btn="api/safeCheck/safe/u"
							ng-click="checkConfiguration.edit()" >
						<div ng-hide="checkConfiguration.editable || !checkConfiguration.activeCategory.leaf"> <i class="fa fa-pencil"></i>
							<span>编辑</span>
						</div>
					</div>
					<div ng-show="checkConfiguration.editable">
						<div class="edit-item edit-save"
								ng-click="checkConfiguration.saveDutyItem(duty)"> <i class="fa fa-save"></i>
							<span>保存</span>
						</div>
						<div class="edit-item edit-del"
								ng-click="checkConfiguration.cancelEditResponse()">
							<i class="fa fa-reply"></i>
							<span>取消</span>
						</div>
					</div>
				</div>
			</div>
			<div class="main-content">
				<div class="content-outline">
					<form ng-class="{'hasedit':checkConfiguration.editable}"
							name="duty" id="duty" novalidate>
						<div class="response-item">
							<label> <b>*</b>
								标准分：
							</label>
							<div class="form-control-edit">
								<input class="form-control" name="standardScore" required 
		               ng-model="checkConfiguration.editableCategory.standardScore"/>
							</div>
							<div class="form-control-unedit">{{checkConfiguration.activeCategory.standardScore}}</div>
							<span class="score">分</span>
							<span class="error-tip" 
								  ng-show="(duty.$submitted || duty.standardScore.$dirty) && duty.standardScore.$error.required">必填</span>
						</div>
						<div class="response-item">
							<label> <b>*</b>
								考核内容：
							</label>
							<div class="form-control-edit form-controls">
								<textarea name="checkContent" required
										ng-change="checkConfiguration.checkText();" 
										ng-model="checkConfiguration.editableCategory.checkContent"></textarea>
							</div>
							<span class="error-tip" 
								  ng-show="(duty.$submitted || duty.checkContent.$dirty) && duty.checkContent.$error.required">必填</span>
							<div class="addition-reason"
									style="margin-left: 100px;color: #fd8c71;font-size: 12px;" 
								  ng-show="checkConfiguration.reasonAddition">考核内容不能超过500个字数</div>
							<div class="form-control-unedit form-controls">{{checkConfiguration.activeCategory.checkContent}}</div>
						</div>
						<div class="response-item">
							<label>
								<b>*</b>
								考核方法：
							</label>
							<div class="form-control-edit form-controls">
								<textarea name="checkMethod" required 
										ng-model="checkConfiguration.editableCategory.checkMethod"></textarea>
							</div>
							<span class="error-tip" 
								  ng-show="(duty.$submitted || duty.checkMethod.$dirty) && duty.checkMethod.$error.required">必填</span>
							<div class="form-control-unedit form-controls">{{checkConfiguration.activeCategory.checkMethod}}</div>
						</div>
					</form>
				</div>
			</div>
			<div class="content-table">
				<div class="content-table-title"
					ng-show="checkConfiguration.activeCategory && checkConfiguration.activeCategory.leaf"
					authorization-btn="api/safeCheck/safecheck/i"
					ng-click="checkConfiguration.openItemDetail()">
					<img src="../../../assets/images/add-item-exam.png">
					<span>新增考核内容</span>
				</div>
				<div class="list-detail">
					<form class="base-info pa-form-content">
						<table class="pa-table">
							<thead>
								<tr>
									<th>考核内容</th>
									<th>扣分描述</th>
									<th>分值</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<tr
		                ng-repeat="item in checkConfiguration.activeCategory.safeCheckProjectList">
									<td class="teach-assess">{{item.checkProjectDescribe}}</td>
									<td>{{checkConfiguration.getPenaltyPointsType(item.kouFenType)}}</td>
									<td class="teach-data">{{checkConfiguration.getPenaltyPointsValue(item)}}</td>
									<td>
										<div class="del"
  	                		ng-click="checkConfiguration.editCheckItem(item)"
  	                		authorization-btn="api/safeCheck/safecheck/u">
											<i class="fa fa-pencil color"></i>
											<span>编辑</span>
										</div>
										<div class="del"
  	                		ng-click="checkConfiguration.deleteCheckItem(item.id)"
  	                		authorization-btn="api/safeCheck/safecheck/d">
											<i class="fa fa-trash color"></i>
											<span>
												删除
												<span></div>
									</td>
								</tr>
							</tbody>
						</table>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>

		<!-- 新增考核项弹窗 -->
<script type="text/ng-template" id="dialogAssessment">
  <div class="item-detail-dialog">
    <div class="item-detail-dialog-header">
      <div class="title-txt">
        <span>新增考核项</span>
      </div>
    </div>
    <div class="item-detail-dialog-content">
    	<form name="addForm" novalidate>
	      <div class="row-item">
	        <div class="fixed-left-label"><b>*</b>考核内容：</div>
	        <div class="right-value" style="width: 228px;">
	          <div class="line">
	          	<input name="checkProjectDescribe" required
	          		ng-model="cfgAdd.category.checkProjectDescribe"
	          		ng-change="cfgAdd.checkText()" />         		
	          	<div class="addition-reason"
	          		style="color: #fd8c71;font-size: 12px;" 
	          	  ng-show="cfgAdd.reasonAddition">考核内容不能超过50个字数</div>
	          </div>
	        </div>
	        <span class="error-tip" 
	          ng-show="(addForm.$submitted || addForm.checkProjectDescribe.$dirty) && addForm.checkProjectDescribe.$error.required">必填</span>
	      </div>
	      <div class="row-item">
	        <div class="row-item">
	          <div class="fixed-left-label"><b>*</b>扣分方式：</div>
	          <div class="right-value">
	            <div class="line">
	              <select name="koufenType" required 
	               ng-model="cfgAdd.category.kouFenType">
	                <option value="1" selected="selected">按分值扣分</option>
	                <option value="2">每发现一个问题扣一次分</option>
	              </select>
	            </div>
	          </div>
	          <span class="error-tip" 
	            ng-show="(addForm.$submitted || addForm.koufenType.$dirty) && addForm.koufenType.$error.required">必填</span>
	        </div>
	      </div> 
	      <div class="row-item">
	        <div class="fixed-left-label"><b>*</b>扣分标准：</div>
	        <div class="right-value" style="width: 224px;">
	      	  <input type="text" name="kouFenLower" required double
	      	  	class="form-control score-standard"
	          	ng-model="cfgAdd.category.kouFenLower"/>
				    <span class="assessment-score">到</span>
				    <input type="text" name="kouFenUpper" required double
				    	class="form-control score-standard"
	          	ng-model="cfgAdd.category.kouFenUpper"/>
				    <span class="assessment-score">分</span>
	         	<div>(若分数唯一请填写相同分数)</div>    	
	      	</div>
		      <span class="error-tip" 
		        ng-show="(addForm.$submitted || addForm.kouFenLower.$dirty || addForm.kouFenUpper.$dirty) && (addForm.kouFenLower.$error.required || addForm.kouFenUpper.$error.required)">必填</span>
		      <span class="error-tip" style="margin-left: 36px;" 
		        ng-show="(addForm.$submitted || addForm.kouFenLower.$dirty || addForm.kouFenUpper.$dirty) && (addForm.kouFenLower.$error.double || addForm.kouFenUpper.$error.double)">填数字</span>
    	</form>
      </div>             
    </div>
    <div class="item-detail-dialog-footer">
      <a class="pa-btn" ng-click="cfgAdd.submit(addForm)">
        <i class="fa fa-save"></i>
        <span>确定</span>
      </a>
      <a class="pa-btn" ng-click="closeThisDialog()">
        <i class="fa fa-times"></i>
        <span>取消</span>
      </a>
    </div>
  </div>
</script>

		<!-- 编辑考核项弹窗 -->
<script type="text/ng-template" id="editDialogAssessment">
  <div class="item-detail-dialog">
    <div class="item-detail-dialog-header">
      <div class="title-txt">
        <span>编辑考核项</span>
      </div>
    </div>
    <div class="item-detail-dialog-content">
    	<form name="addForm" novalidate>
	      <div class="row-item">
	        <div class="fixed-left-label"><b>*</b>考核内容：</div>
	        <div class="right-value" style="width: 228px;">
	          <div class="line">
	          	<input name="checkProjectDescribe" required
	          		ng-model="vm.category.checkProjectDescribe"
	          		ng-change="vm.checkText()" />         		
	          	<div class="addition-reason"
	          		style="color: #fd8c71;font-size: 12px;" 
	          	  ng-show="vm.reasonAddition">考核内容不能超过50个字数</div>
	          </div>
	        </div>
	        <span class="error-tip" 
	          ng-show="(addForm.$submitted || addForm.checkProjectDescribe.$dirty) && addForm.checkProjectDescribe.$error.required">必填</span>
	      </div>
	      <div class="row-item">
	        <div class="row-item">
	          <div class="fixed-left-label"><b>*</b>扣分方式：</div>
	          <div class="right-value">
	            <div class="line">
	              <select name="koufenType" required 
	               ng-model="vm.category.kouFenType">
	                <option value="1"
	                	ng-selected="{{vm.category.kouFenType == '1'}}">按分值扣分</option>
	                <option value="2"
	                	ng-selected="{{vm.category.kouFenType == '2'}}">每发现一个问题扣一次分</option>
	              </select>
	            </div>
	          </div>
	          <span class="error-tip" 
	            ng-show="(addForm.$submitted || addForm.koufenType.$dirty) && addForm.koufenType.$error.required">必填</span>
	        </div>
	      </div> 
	      <div class="row-item">
	        <div class="fixed-left-label"><b>*</b>扣分标准：</div>
	        <div class="right-value" style="width: 224px;">
	      	  <input type="text" name="kouFenLower" required double
	      	  	class="form-control score-standard"
	          	ng-model="vm.category.kouFenLower"/>
				    <span class="assessment-score">到</span>
				    <input type="text" name="kouFenUpper" required double
				    	class="form-control score-standard"
	          	ng-model="vm.category.kouFenUpper"/>
				    <span class="assessment-score">分</span>
	         	<div>(若分数唯一请填写相同分数)</div>    	
	      	</div>
		      <span class="error-tip" 
		        ng-show="(addForm.$submitted || addForm.kouFenLower.$dirty || addForm.kouFenUpper.$dirty) && (addForm.kouFenLower.$error.required || addForm.kouFenUpper.$error.required)">必填</span>
		      <span class="error-tip" style="margin-left: 36px;"
		        ng-show="(addForm.$submitted || addForm.kouFenLower.$dirty || addForm.kouFenUpper.$dirty) && (addForm.kouFenLower.$error.double || addForm.kouFenUpper.$error.double)">填数字</span>
    	</form>
      </div>             
    </div>
    <div class="item-detail-dialog-footer">
      <a class="pa-btn" ng-click="vm.submit(addForm)">
        <i class="fa fa-save"></i>
        <span>确定</span>
      </a>
      <a class="pa-btn" ng-click="closeThisDialog()">
        <i class="fa fa-times"></i>
        <span>取消</span>
      </a>
    </div>
  </div>
</script>